
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap-responsive.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/style.css}" />
    <script type="text/javascript" th:src="@{/Js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/Js/jquery.sorted.js}"></script>
    <script type="text/javascript" th:src="@{/Js/bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/Js/ckform.js}"></script>
    <script type="text/javascript" th:src="@{/Js/common.js}"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="../index.html" method="get">
    用户名称：
    <input type="text" name="username" id="username"class="abc input-default" placeholder="" value="">&nbsp;&nbsp;
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addnew">
    新增用户
</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>用户id</th>
        <th>用户名称</th>
        <th>真实姓名</th>
        <th>性别</th>
        <th>城市</th>
        <th>邮箱</th>
        <th>注册时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tr th:each="user:${userlist}">
        <td th:text="${user.userid}">2</td>
        <td th:text="${user.username}">admin</td>
        <td th:text="${user.realname}">管理员</td>
        <td th:text="${user.sex=='0'?'男':'女'}"></td>
        <td th:text="${#strings.isEmpty('')?'缺省':user.city}"></td>
        <td th:text="${user.email}"></td>
        <td th:text="${#dates.format(user.opentime,'yyyy-MM-dd HH:mm:ss')}"></td>
        <td>
            <a th:href="@{toupdate(userid=${user.userid})}">编辑</a>
            <a th:href="@{deleteuser(userid=${user.userid})}">删除</a>
        </td>
    </tr>
</table>
</body>
</html>
<script>
    $(function () {


        $('#addnew').click(function(){

            window.location.href="toadduser";
        });


    });

    function del(id)
    {


        if(confirm("确定要删除吗？"))
        {

            var url = "index.html";

            window.location.href=url;

        }




    }
</script>